package za.co.felixsol.sf.dxf.reader.entity;

import java.util.List;

import za.co.felixsol.sf.dxf.reader.DxfEntities;
import za.co.felixsol.sf.dxf.reader.DxfEntry;

public class Line extends DxfEntity {

	public Line(DxfEntities dxfEntities, DxfEntry entity, List<DxfEntry> parameters) {
		super(dxfEntities, entity, parameters);
//		System.out.println(this);
	}
	
	public Double getStartX() {
		return findDxfEntry(10).getValue();
	}

	public Double getStartY() {
		return findDxfEntry(20).getValue();
	}

	public Double getStartZ() {
		return findDxfEntry(30).getValue();
	}

	public Double getEndX() {
		return findDxfEntry(11).getValue();
	}

	public Double getEndY() {
		return findDxfEntry(21).getValue();
	}

	public Double getEndZ() {
		return findDxfEntry(31).getValue();
	}

	@Override
	public String toString() {
		return String.format("Line (%f, %f, %f) - (%f, %f, %f)", getStartX(), getStartY(), getStartZ(), getEndX(), getEndY(), getEndZ()); 
	}
	
}
